Extended SSA Numbering: Introducing SSA properties to languages with multi-level pointers
نویسندگان
چکیده
Static Single Assignment (SSA) intermediate representations have become quite popular in compiler development. One advantage of the SSA form is that each use of a variable corresponds to exactly one de nition, and thus two references of the same SSA variable must denote the same value. To date, most SSA forms concentrate on scalar variables, and it is di cult to extend these intermediate representations to languages with multi-level pointers like C. Translating a program into SSA form requires two steps. The rst is inserting -nodes that join values from di erent ow of control paths, and the other renames variables such that each name has exactly one de nition. When designing SSA forms to handle pointers, the insertion of -nodes is quite di cult. Thus, we propose a method that concentrates on the second step, in that we associate an SSA number to each variable reference, including references via pointers. Even without -nodes, we retain some of the properties of SSA such as \one value per name" when the SSA number is used as part of the name. In addition to a primary SSA number for scalar variables we introduce a secondary SSA number for pointers. Given an indirect reference of the form *p, the primary number refers to the contents of p and the secondary number refers to the contents of *p. Using both primary and secondary SSA numbers we can tell when two indirect references denote the same value, as well as derive other SSA properties for indirect references. In this paper we show how we have implemented Extended SSA Numbering in the McCAT C Compiler, and demonstrate its usefulness by strengthening reaching de nitions analysis and developing a new optimizing transformation. i
منابع مشابه
Extended SSA Numbering: Introducing SSA Properties to Language with Multi-level Pointers
Static Single Assignment (SSA) intermediate representations have become quite popular in compiler development. One advantage of the SSA form is that each variable corresponds to exactly one deenition, and thus two references of the same SSA variable must denote the same value. To date, most SSA forms concentrate on scalar variables, and it is diicult to extend these intermediate representations...
متن کاملSea Surfaces Scattering by Multi-Order Small-Slope Approximation: a Monte-Carlo and Analytical Comparison
L-band electromagnetic scattering from two-dimensional random rough sea surfaces are calculated by first- and second-order Small-Slope Approximation (SSA1, 2) methods. Both analytical and numerical computations are utilized to calculate incoherent normalized radar cross-section (NRCS) in mono- and bi-static cases. For evaluating inverse Fourier transform, inverse fast Fourier transform (IFFT) i...
متن کاملA Formally Verified SSA-Based Middle-End - Static Single Assignment Meets CompCert
CompCert is a formally verified compiler that generates compact and efficient PowerPC, ARM and x86 code for a large and realistic subset of the C language. However, CompCert foregoes using Static Single Assignment (SSA), an intermediate representation that allows for writing simpler and faster optimizers, and is used by many compilers. In fact, it has remained an open problem to verify formally...
متن کاملUnified Analysis of Array and Object References in Strongly Typed Languages
We present a simple, unified approach for the analysis and optimization of object field and array element accesses in strongly typed languages, that works in the presence of object references/pointers. This approach builds on Array SSA form [14], a uniform representation for capturing control and data flow properties at the level of array elements. The techniques presented here extend previous ...
متن کاملInter-iteration Scalar Replacement Using Array SSA Form
In this paper, we introduce novel simple and efficient analysis algorithms for scalar replacement and dead store elimination that are built on Array SSA form, a uniform representation for capturing control and data flow properties at the level of array or pointer accesses. We present extensions to the original Array SSA form representation to capture loop-carried data flow information for array...
متن کامل